export default (doc: { documentElement: HTMLElement; addEventListener: (arg0: string, arg1: () => void, arg2: boolean) => void; },
    win: { addEventListener: (arg0: string, arg1: () => void, arg2: boolean) => void; }) => {
    const docEI = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientataionchange' : 'resize',
        recalc = function () {
            const clientWidth = docEI.clientWidth;
            if (!clientWidth) return;
            //100是字体大小，1536是开发时浏览器窗口的宽度，等比计算
            docEI.style.fontSize = 100 * (clientWidth / 1536) + 'px';
        }

    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
}